//
//  MusicView.m
//  JZMCFM
//
//  Created by Mc on 15/11/5.
//  Copyright (c) 2015年 陈卓. All rights reserved.
//

#import "MusicView.h"
#define kButton [UIButton buttonWithType:UIButtonTypeSystem]
@implementation MusicView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createMusicView];
    }
    return self;
}

- (void)createMusicView
{
    self.imageView = [[UIImageView alloc] initWithFrame:self.frame];
    UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
    UIVisualEffectView *view1 = [[UIVisualEffectView alloc]initWithEffect:beffect];
    self.imageView.userInteractionEnabled = YES;
    view1.frame = self.imageView.bounds;
    [self addSubview:self.imageView];
    [self.imageView addSubview:view1];
    
    self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(kscreenwidth / 2 - 100, 30, 200, 200)];
    [self.imageView addSubview:self.imageV];
    self.imageV.layer.cornerRadius = 100;
    self.imageV.clipsToBounds = YES;
    
    self.introL = [[UILabel alloc] initWithFrame:CGRectMake(40, CGRectGetMaxY(self.imageV.frame) + 15, 295, 150)];
    self.introL.font = [UIFont systemFontOfSize:16.0];
    self.introL.layer.borderWidth = 1;
    self.introL.numberOfLines = 0;
    self.introL.layer.cornerRadius = 10;
    [self.imageView addSubview:self.introL];
    
    self.zanButton = kButton;
    self.zanButton.frame = CGRectMake(82.5, CGRectGetMaxY(self.introL.frame) + 15, 30, 45);
    [self.imageView addSubview:self.zanButton];
    
    self.zanImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    [self.zanButton addSubview:self.zanImageView];
    
    self.zanLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.zanImageView.frame), 30, 15)];
    self.zanLabel.font = [UIFont systemFontOfSize:13.0];
    [self.zanButton addSubview:self.zanLabel];
    
    self.downButton = kButton;
    self.downButton.frame = CGRectMake(CGRectGetMaxX(self.zanButton.frame) + 60, CGRectGetMaxY(self.introL.frame) + 15, 30, 45);
    [self.imageView addSubview:self.downButton];
    
    self.downImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    [self.downButton addSubview:self.downImageView];
    
    self.downLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.downImageView.frame), 30, 15)];
    self.downLabel.font = [UIFont systemFontOfSize:13.0];
    [self.downButton addSubview:self.downLabel];
    
    self.shareButton = kButton;
    self.shareButton.frame = CGRectMake(CGRectGetMaxX(self.downButton.frame) + 60, CGRectGetMaxY(self.introL.frame) + 15, 30, 45);
    [self.imageView addSubview:self.shareButton];
    
    self.shareImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    [self.shareButton addSubview:self.shareImageView];
    
    self.shareLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.shareImageView.frame), 30, 15)];
    self.shareLabel.font = [UIFont systemFontOfSize:13.0];
    [self.shareButton addSubview:self.shareLabel];
    
    
    self.slider = [[UISlider alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.shareButton.frame) + 20, kscreenwidth, 30)];
    [self.imageView addSubview:self.slider];
    
    self.startL = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMinY(self.slider.frame) - 20, 60, 20)];
    self.startL.font = [UIFont systemFontOfSize:12];
    [self.imageView addSubview:self.startL];
    
    self.totalL = [[UILabel alloc] initWithFrame:CGRectMake(315, CGRectGetMinY(self.slider.frame) - 20, 60, 20)];
    self.totalL.font = [UIFont systemFontOfSize:12];
    self.totalL.textAlignment = NSTextAlignmentRight;
    [self.imageView addSubview:self.totalL];
    
    self.lastButton = kButton;
    [self.lastButton setBackgroundImage:[UIImage imageNamed:@"mjliconfont-ttpodicon"] forState:UIControlStateNormal];
    self.lastButton.frame = CGRectMake(82.5, CGRectGetMaxY(self.slider.frame) + 10, 30, 30);
    [self.imageView addSubview:self.lastButton];
    
    self.playButton = kButton;
    
    self.playButton.frame = CGRectMake(CGRectGetMaxX(self.lastButton.frame) + 60, CGRectGetMinY(self.lastButton.frame), CGRectGetWidth(self.lastButton.frame), CGRectGetHeight(self.lastButton.frame));
    [self.imageView addSubview:self.playButton];
    
    self.nextButton = kButton;
    [self.nextButton setBackgroundImage:[UIImage imageNamed:@"mjliconfont-ttpodicon(1)"] forState:UIControlStateNormal];
    self.nextButton.frame = CGRectMake(CGRectGetMaxX(self.playButton.frame) + 60, CGRectGetMinY(self.playButton.frame), CGRectGetWidth(self.lastButton.frame), CGRectGetHeight(self.lastButton.frame));
    [self.imageView addSubview:self.nextButton];
    
    
    
    
}

@end
